Skip to content

Conversation

Darshan808
Copy link
Contributor

Fixes #1515

Description

This PR improves compatibility in environments where the working directory is read-only but the file isn't.

  • atomic_writing fallback: If the parent directory is not writable but the file is, fall back to direct write instead of using atomic write with a temp file.
  • Checkpoints: If the .ipynb_checkpoints directory is not writable, redirect checkpoints to a temp path:
    $TMPDIR/jupyter_checkpoints/<rel_path>.

This ensures writing and checkpointing continue to work smoothly in restricted or non-standard setups.

@krassowski krassowski added the bug label Apr 24, 2025
Copy link
Collaborator

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@afshin afshin merged commit d8ebeb1 into jupyter-server:main May 1, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saving a writable file in a non-writable directory is not possible

3 participants